<?php
namespace app\api\controller;
use think\Db;
use app\admin\model\Config;
use app\common\model\School as SchoolModel;
use app\common\service\GuguService;
use app\common\service\ZhiyuanService;

//志愿填报 一键填报
class ZhiyuanOnekey extends App
{
    
    public static function WhiteList()
    {
        return [
           
           
			
        ];
    }
	
    //个人偏好设置-不考虑省份
    public function address_config(){
        $user_id = $this->user_id;
        if($this->request->isPost()){
			
			$province_ids = $this->request->post("province_ids",'','trim');
			if(empty($province_ids)){
				return $this->show(2001,"缺少province_ids!", '');
			}
			
			$flag = Db::name("member_zhiyuan_config")->where('user_id',$user_id)->value('id');
			if(empty($flag)){
                $res = Db::name("member_zhiyuan_config")->insert(['user_id'=>$user_id,'no_province_ids'=>$province_ids,'create_time'=>time()]);
			}else{
				$res = Db::name("member_zhiyuan_config")->where('id',$flag)->update(['no_province_ids'=>$province_ids,'update_time'=>time()]);
			}
			if( $res !== false ){
				return $this->show(1,"success", '');
			}else{
				return $this->show(2002, "fail", "");
			} 
		}else{
            return $this->show(2001, "非法请求", "");
        }
    }
    public function school_config(){
        $user_id = $this->user_id;
        if($this->request->isPost()){
			
			$school_id = $this->request->post("school_id",0,'intval');
			if(empty($school_id)){
				return $this->show(2001,"缺少school_id!", '');
			}
			
			$member_zhiyuan_config = Db::name("member_zhiyuan_config")->where('user_id',$user_id)->field('id,school_ids')->find();
			if(empty($member_zhiyuan_config)){
                $res = Db::name("member_zhiyuan_config")->insert(['user_id'=>$user_id,'school_ids'=>$school_id,'create_time'=>time()]);
			}else{
				if(!empty($member_zhiyuan_config['school_ids'])){
					$school_ids = explode(',',$member_zhiyuan_config['school_ids']);
				}else{
					$school_ids = [];
				}
				array_push($school_ids,$school_id);
				$school_ids = array_values(array_unique($school_ids));
				$school_ids = implode(',',$school_ids);
				$res = Db::name("member_zhiyuan_config")->where('id',$member_zhiyuan_config['id'])->update(['school_ids'=>$school_ids,'update_time'=>time()]);
			}
			if( $res !== false ){
				return $this->show(1,"success", '');
			}else{
				return $this->show(2002, "fail", "");
			} 
		}else{
            return $this->show(2001, "非法请求", "");
        }
    }
    public function school_del(){
        $user_id = $this->user_id;
        if($this->request->isPost()){
			
			$school_id = $this->request->post("school_id",0,'intval');
			if(empty($school_id)){
				return $this->show(2001,"缺少school_id!", '');
			}

			
			$member_zhiyuan_config = Db::name("member_zhiyuan_config")->where('user_id',$user_id)->field('id,school_ids')->find();
			if(!empty($member_zhiyuan_config)){
                $school_ids = explode(',',$member_zhiyuan_config['school_ids']);
				$newArr = array_diff($school_ids, [$school_id]);
				$school_ids = array_values(array_unique($newArr));
				$school_ids = implode(',',$school_ids);
				//dump($school_ids);die;
				$res = Db::name("member_zhiyuan_config")->where('id',$member_zhiyuan_config['id'])->update(['school_ids'=>$school_ids,'update_time'=>time()]);
			}
			
			if( $res !== false ){
				return $this->show(1,"success", '');
			}else{
				return $this->show(2002, "fail", "");
			} 
		}else{
            return $this->show(2001, "非法请求", "");
        }
    }
    public function major_config(){
        $user_id = $this->user_id;
        if($this->request->isPost()){
			
			$major_id = $this->request->post("major_id",0,'intval');
			if(empty($major_id)){
				return $this->show(2001,"缺少major_id!", '');
			}
			
			$member_zhiyuan_config = Db::name("member_zhiyuan_config")->where('user_id',$user_id)->field('id,major_ids')->find();
			if(empty($member_zhiyuan_config)){
                $res = Db::name("member_zhiyuan_config")->insert(['user_id'=>$user_id,'major_ids'=>$major_id,'create_time'=>time()]);
			}else{
				if(!empty($member_zhiyuan_config['major_ids'])){
					$major_ids = explode(',',$member_zhiyuan_config['major_ids']);
				}else{
					$major_ids = [];
				}
				array_push($major_ids,$major_id);
				$major_ids = array_values(array_unique($major_ids));
				$major_ids = implode(',',$major_ids);
				$res = Db::name("member_zhiyuan_config")->where('id',$member_zhiyuan_config['id'])->update(['major_ids'=>$major_ids,'update_time'=>time()]);
			}
			if( $res !== false ){
				return $this->show(1,"success", '');
			}else{
				return $this->show(2002, "fail", "");
			} 
		}else{
            return $this->show(2001, "非法请求", "");
        }
    }
    public function major_del(){
        $user_id = $this->user_id;
        if($this->request->isPost()){
			
			$major_id = $this->request->post("major_id",0,'intval');
			if(empty($major_id)){
				return $this->show(2001,"缺少major_id!", '');
			}

			
			$member_zhiyuan_config = Db::name("member_zhiyuan_config")->where('user_id',$user_id)->field('id,major_ids')->find();
			if(!empty($member_zhiyuan_config)){
                $major_ids = explode(',',$member_zhiyuan_config['major_ids']);
				$newArr = array_diff($major_ids, [$major_id]);
				$major_ids = array_values(array_unique($newArr));
				$major_ids = implode(',',$major_ids);
				//dump($school_ids);die;
				$res = Db::name("member_zhiyuan_config")->where('id',$member_zhiyuan_config['id'])->update(['major_ids'=>$major_ids,'update_time'=>time()]);
			}
			
			if( $res !== false ){
				return $this->show(1,"success", '');
			}else{
				return $this->show(2002, "fail", "");
			} 
		}else{
            return $this->show(2001, "非法请求", "");
        }
    }
	
	//个人偏好设置-获取配置信息
    public function get_config()
    {
        
		$user_id = $this->user_id;
		$config = Db::name("member_zhiyuan_config")->field('no_province_ids,school_ids,major_ids')->where('user_id',$user_id)->find();
		
		$no_province_ids = $config['no_province_ids'];
		
		$school_list = Db::name("school")->where('id','in',$config['school_ids'])->field('id,college_name,cover_image,province_id,city_id,xian_id,school_suoshu,ranking,school_type,school_xingzhi')->order('ranking asc,id desc')->select(); 
		$suoshu_list = SchoolModel::getSuoshuList();
		foreach($school_list as $k=>$v){
			$school_list[$k]['province'] = Db::name('area')->where('id',$v['province_id'])->value('name');
			$school_list[$k]['city'] = Db::name('area')->where('id',$v['city_id'])->value('name');
			$school_list[$k]['district'] = Db::name('area')->where('id',$v['xian_id'])->value('name');
			//$school_list[$k]['school_type'] = Db::name('school_type_data')->alias('d')->join('school_type t','d.type_id=t.id')->where('d.school_id',$v['id'])->value('t.title');
			$school_list[$k]['school_type'] = Db::name('school_type')->where('id',$v['school_type'])->value('title');
			//$school_list[$k]['school_xingzhi'] = Db::name('school_xingzhi_data')->alias('d')->join('school_xingzhi x','d.xingzhi_id=x.id')->where('d.school_id',$v['id'])->value('x.title');
			$school_list[$k]['school_xingzhi'] = Db::name('school_xingzhi')->where('id',$v['school_xingzhi'])->value('title');
			$school_list[$k]['school_suoshu'] = !empty($suoshu_list[$v['school_suoshu']])?$suoshu_list[$v['school_suoshu']]:'';
			$school_list[$k]['school_tese'] = Db::name('school_tese_data')->alias('d')->join('school_tese t','d.tese_id=t.id')->where('d.school_id',$v['id'])->column('t.title');
			unset($school_list[$k]['province_id']);
			unset($school_list[$k]['city_id']);
			unset($school_list[$k]['xian_id']);
		} 
		
		$major_list = Db::name("major")->where('id','in',$config['major_ids'])->field('id,cate_title')->select(); 
		
		$list= ['no_province_ids'=>$no_province_ids,'school_list'=>$school_list,'major_list'=>$major_list];
		return $this->show(1,"成功", $list);
		
    }
	
	
	//开始一键填报
    /*public function get_school_list()
    {
		//dump('{"appkey":"TZK6DJZ5LVS6V8LYDAS9WE3K4TM8ZQWZ","pageindex":1,"pagesize":100,"enrollprovince":"河北","schooluuid":"1a49214a6404554a73caaa0d5b0ba4e9","year":"2024","minrange":"560,640","typename":"物理类","batchname":"国家专项计划本科一批,国家专项计划本科批,本科一批次,提前本科批,普通本科批,本科A批,本科A段,本科B批,本科一批,本科一批A1段,本科一批A段,本科一批B段,本科一批H段,本科一批I段,本科一批U段,本科一批预科,本科一段,本科三批,本科三批A段,本科三批B段,本科专项计划批,本科二批,本科二批A段,本科二批B段,本科二批C段,本科二批K段,本科二批及预科,本科二段,本科批,本科批A段,本科批B段,本科批C段,本科批一段,本科提前批,本科提前批A段,本科提前批B段,本科提前批C,本科提前批C段"}');die;
		//dump(strlen('国家专项计划本科一批,国家专项计划本科批,本科一批次,提前本科批,普通本科批,本科A批,本科A段,本科B批,本科一批,本科一批A1段,本科一批A段,本科一批B段,本科一批H段,本科一批I段,本科一批U段,本科一批预科,本科一段,本科三批,本科三批A段,本科三批B段,本科专项计划批,本科二批,本科二批A段,本科二批B段,本科二批C段,本科二批K段,本科二批及预科,本科二段,本科批,本科批A段,本科批B段,本科批C段,本科批一段,本科提前批,本科提前批A段,本科提前批B段,本科提前批C,本科提前批C段'));die;
		set_time_limit(0); 
		
		$user_id = $this->user_id;
		$province_id = $this->province_id;
        $pagesize = 40;
        $page = 1; 
        $batch= $this->request->get("batch",1,'intval');
        if(empty($batch)){
            return $this->show(2001,"缺少参数batch!", '');
        }
        
        
        $province_ids= $this->request->get("province_ids",'','trim');
        $school_ids_1= $this->request->get("school_ids",'','trim'); 
      
        $major_ids = $this->request->get("major_ids",'','trim');
		$major_ids = explode(',',$major_ids);
		$major_ids = array_filter(array_unique($major_ids));
		$major_school_ids = [];
		if(!empty($major_ids)){
			foreach($major_ids as $km=>$vm){
				$major_school_id = Db::name('school_major_data')->where('FIND_IN_SET(:id,major_ids)',['id' => $vm])->column('school_id');
				$major_school_ids = array_merge($major_school_ids,$major_school_id);
				
			}
		}
		//dump($major_ids);die;

    
		
		if(!empty($major_school_ids)){
			$map['id'] = ['in',$major_school_ids];
        }
		
		
		$map['status'] = 1;
		$school_ids_ed = Db::name("school")->where($map)->column('id');
		if(!empty($school_ids_1)){
			$school_ids_1 = explode(',',$school_ids_1);
			$school_ids_ed = array_filter(array_unique(array_merge($school_ids_ed,$school_ids_1))); 
		}
		//$school_list = Db::name("school")->where('id','in',$school_ids_ed)->column('school_uuid,id');
		//$school_uuids_ed = array_keys($school_list);
		$school_list = Db::name("school")->where('id','in',$school_ids_ed)->field('school_uuid,id,school_suoshu,college_code,school_type')->select();
		$school_uuids_ed = array_column($school_list,'school_uuid');
		$school_suoshu_ed = array_column($school_list,'school_suoshu','school_uuid');
		$school_id_ed = array_column($school_list,'id','school_uuid');
		$school_type_ed = array_column($school_list,'school_type','school_uuid');
		//dump($school_list);die;
		$school_tese = Db::name('school_tese_data')->alias('d')->join('school_tese t','d.tese_id=t.id')->where('d.school_id','in',$school_ids_ed)->field('d.school_id,t.title')->select();
		$school_tese_new = [];
		foreach($school_tese as $kt=>$vt){
			$school_tese_new[$vt['school_id']][] = $vt['title'];
			
		}
		//$school_type_ed = Db::name('school_type_data')->alias('d')->join('school_type t','d.type_id=t.id')->where('d.school_id','in',$school_ids_ed)->column('d.school_id,t.title');
		$school_type_arr = Db::name('school_type')->column('id,title');
		//$school_code_ed = Db::name('school')->where('id','in',$school_ids_ed)->column('id,college_code');
		$school_code_ed = array_column($school_list,'college_code','id');
       
		$enrollprovince = Db::name("area")->where('id',$province_id)->value('name');
		$year = date('Y',strtotime("-1 year"));
		$member = Db::name("member")->field('province_id,cj_score,cj_subjects,cj_subjects1,cj_subject_mode,cj_subject_mode_title,cj_rank')->where('id',$user_id)->find();
		$score_min = $member['cj_score']-40;
		$score_max = $member['cj_score']+40;
		$type = $member['cj_subject_mode_title'];
		
		
		if($batch == 1){
			$batchname = SchoolModel::getBenkeBtachs();
			$batch_score_name = '本科';
		}elseif($batch == 2){
			$batchname = SchoolModel::getZhuankeBtachs();
			$batch_score_name = '专科';
		}else{
			return $this->show(2001,"参数batch错误!", '');
		}
		$batch_score = Db::name("batch_line")->where('batch_name',$batch_score_name)->where('province_id',$province_id)->where('year',$year)->value('socre');//批次分数
		//dump($school_uuids_ed);die;
		$result = GuguService::make('/metadata/ceecollegeline',['appkey'=>'UZ8X3YJWLFJWJKY28U63K8YFUTQZX4RD','pageindex'=>$page,'pagesize'=>$pagesize,'searchtype'=>'PROVINCENAME','keyword'=>$enrollprovince,'year'=>$year,'minrange'=>$score_min.','.$score_max,'type'=>$type,'batchname'=>$batchname]);
		if($result[0] != 200){
            return $this->show(2002,$result[1]??'error', '');
		}
		$list = $result[1][1];
		//$count = $result[1][0]['DataTotalCount'];
		//$count = count($list);
		
		$year1 = date('Y',strtotime("-2 year"));
		$year2 = date('Y',strtotime("-3 year"));
		$batch_score1 = Db::name("batch_line")->where('batch_name',$batch_score_name)->where('province_id',$province_id)->where('year',$year1)->value('socre');//批次分数
		$batch_score2 = Db::name("batch_line")->where('batch_name',$batch_score_name)->where('province_id',$province_id)->where('year',$year2)->value('socre');//批次分数
		
		//23年院校数据
		$result_1 = GuguService::make('/metadata/ceecollegeline',['appkey'=>'UZ8X3YJWLFJWJKY28U63K8YFUTQZX4RD','pageindex'=>$page,'pagesize'=>100,'searchtype'=>'PROVINCENAME','keyword'=>$enrollprovince,'year'=>$year1,'minrange'=>$score_min.','.$score_max,'type'=>$type,'batchname'=>$batchname]);
		if($result_1[0] != 200){
            $list_1 = [];
		}else{
			$list_1 = $result_1[1][1];
		}
		$list_school_1 = [];
		if(!empty($list_1)){
			foreach($list_1 as $k=>$v){
				if(empty($member['cj_rank'])){
					$dengxiao_weicha = '-';
				}else{
					if(!empty($v['LowestRank']) && is_numeric($v['LowestRank'])){
						$dengxiao_weicha = $v['LowestRank']-$member['cj_rank'];
					}else{
						$dengxiao_weicha = '-';
					}
				}
				if(empty($batch_score)){
					$linecha = '-';
				}else{
					if(!empty($v['LowestScore']) && is_numeric($v['LowestScore'])){
						$linecha = $v['LowestScore']-$batch_score;
					}else{
						$linecha = '-';
					}
				}
				$list_school_1[] = ['school_uuid'=>$v['SchoolUUID'],'score_min'=>$v['LowestScore'],'weici_min'=>$v['LowestRank'],'dengxiao_weicha'=>$dengxiao_weicha,'linecha'=>$linecha];
			}	
		}
		//22年院校数据
		$result_2 = GuguService::make('/metadata/ceecollegeline',['appkey'=>'UZ8X3YJWLFJWJKY28U63K8YFUTQZX4RD','pageindex'=>$page,'pagesize'=>100,'searchtype'=>'PROVINCENAME','keyword'=>$enrollprovince,'year'=>$year2,'minrange'=>$score_min.','.$score_max,'type'=>$type,'batchname'=>$batchname]);
		if($result_2[0] != 200){
            $list_2 = [];
		}else{
			$list_2 = $result_2[1][1];
		}
		$list_school_2 = [];
		if(!empty($list_2)){
			foreach($list_2 as $k=>$v){
				if(empty($member['cj_rank'])){
					$dengxiao_weicha = '-';
				}else{
					if(!empty($v['LowestRank']) && is_numeric($v['LowestRank'])){
						$dengxiao_weicha = $v['LowestRank']-$member['cj_rank'];
					}else{
						$dengxiao_weicha = '-';
					}
				}
				if(empty($batch_score)){
					$linecha = '-';
				}else{
					if(!empty($v['LowestScore']) && is_numeric($v['LowestScore'])){
						$linecha = $v['LowestScore']-$batch_score;
					}else{
						$linecha = '-';
					}
				}
				$list_school_2[] = ['school_uuid'=>$v['SchoolUUID'],'score_min'=>$v['LowestScore'],'weici_min'=>$v['LowestRank'],'dengxiao_weicha'=>$dengxiao_weicha,'linecha'=>$linecha];
			}	
		}
		
		
		$list_new = [];
		$suoshu_list = SchoolModel::getSuoshuList();	
		if(!empty($list)){
			foreach($list as $k=>$v){
				if(in_array($v['SchoolUUID'],$school_uuids_ed)){
					$school_suoshu = !empty($school_suoshu_ed[$v['SchoolUUID']])?$school_suoshu_ed[$v['SchoolUUID']]:'';
					$school_id = !empty($school_id_ed[$v['SchoolUUID']])?$school_id_ed[$v['SchoolUUID']]:'';
					$school_tese = !empty($school_tese_new[$school_id])?$school_tese_new[$school_id]:'';
					$school_type = !empty($school_type_arr[$school_type_ed[$v['SchoolUUID']]])?$school_type_arr[$school_type_ed[$v['SchoolUUID']]]:'';
					$school_code = !empty($school_code_ed[$school_id])?$school_code_ed[$school_id]:'';
			
			
					//23年数据
					$result = GuguService::make('/metadata/ceemajorline',['appkey'=>'TZK6DJZ5LVS6V8LYDAS9WE3K4TM8ZQWZ','pageindex'=>1,'pagesize'=>100,'enrollprovince'=>$enrollprovince,'schooluuid'=>$v['SchoolUUID'],'year'=>$year1,'minrange'=>$score_min.','.$score_max,'typename'=>$type,'batchname'=>$batchname]);
					//dump($result);die;
					if($result[0] != 200){
						$list_1 = [];
					}else{
						$list_1 = $result[1][1];
					}
					$list_new_1 = [];
					if(!empty($list_1)){
						$list_1 = array_unique_two($list_1);//专业去重
						//获取院校的全部专业的招生计划
						$result_plan = GuguService::make('/metadata/college-enrollment-plan',['appkey'=>'4PRZZRKKA2QXJNHUF3222XWKCNTW7UYC','pageindex'=>1,'pagesize'=>100,'year'=>$year1,'type'=>$type,'provincename'=>$enrollprovince,'schoolname'=>$v['CollegeName']]);
						if($result_plan[0] != 200){
							return $this->show(2002,$result_plan[1]??'error', '');
						}
						$list_plan = $result_plan[1][1];
						$list_plan_number = array_column($list_plan,'EnrollmentNumbers','CollegeMajorName');//整理好专业和招生人数，方便下面模糊匹配
						foreach($list_1 as $k_1=>$v_1){
							if(empty($member['cj_rank'])){
								$dengxiao_weicha = '-';
							}else{
								if(!empty($v_1['LowestSection']) && is_numeric($v_1['LowestSection'])){
									$dengxiao_weicha = $v_1['LowestSection']-$member['cj_rank'];
								}else{
									$dengxiao_weicha = '-';
								}
							}
							if(empty($batch_score1)){
								$linecha = '-';
							}else{
								if(!empty($v_1['LowestScore']) && is_numeric($v_1['LowestScore'])){
									$linecha = $v_1['LowestScore']-$batch_score1;
								}else{
									$linecha = '-';
								}
							}
							$list_new_1[$k_1] = ['major_name'=>$v_1['MajorName'],'major_code'=>$v_1['MajorCode'],'score_min'=>$v_1['LowestScore'],'weici_min'=>$v_1['LowestSection'],'dengxiao_weicha'=>$dengxiao_weicha,'linecha'=>$linecha,'major_code_standard'=>$v_1['MajorStandardCode'],'plan_nums'=>search_plan_like($list_plan_number,$v_1['MajorName'])];
						}
					}
					//22年数据
					$result = GuguService::make('/metadata/ceemajorline',['appkey'=>'TZK6DJZ5LVS6V8LYDAS9WE3K4TM8ZQWZ','pageindex'=>1,'pagesize'=>100,'enrollprovince'=>$enrollprovince,'schooluuid'=>$v['SchoolUUID'],'year'=>$year2,'minrange'=>$score_min.','.$score_max,'typename'=>$type,'batchname'=>$batchname]);
					if($result[0] != 200){
						$list_2 = [];
					}else{
						$list_2 = $result[1][1];
					}
					$list_new_2 = [];
					//dump($list);die;
					if(!empty($list_2)){
						$list_2 = array_unique_two($list_2);//专业去重
						//获取院校的全部专业的招生计划
						$result_plan = GuguService::make('/metadata/college-enrollment-plan',['appkey'=>'4PRZZRKKA2QXJNHUF3222XWKCNTW7UYC','pageindex'=>1,'pagesize'=>100,'year'=>$year2,'type'=>$type,'provincename'=>$enrollprovince,'schoolname'=>$v['CollegeName']]);
						if($result_plan[0] != 200){
							return $this->show(2002,$result_plan[1]??'error', '');
						}
						$list_plan = $result_plan[1][1];
						$list_plan_number = array_column($list_plan,'EnrollmentNumbers','CollegeMajorName');//整理好专业和招生人数，方便下面模糊匹配
						foreach($list_2 as $k_2=>$v_2){
							if(empty($member['cj_rank'])){
								$dengxiao_weicha = '-';
							}else{
								if(!empty($v_2['LowestSection']) && is_numeric($v_2['LowestSection'])){
									$dengxiao_weicha = $v_2['LowestSection']-$member['cj_rank'];
								}else{
									$dengxiao_weicha = '-';
								}
							}
							if(empty($batch_score2)){
								$linecha = '-';
							}else{
								if(!empty($v_2['LowestScore']) && is_numeric($v_2['LowestScore'])){
									$linecha = $v_2['LowestScore']-$batch_score2;
								}else{
									$linecha = '-';
								}
							}
							$list_new_2[$k_2] = ['major_name'=>$v_2['MajorName'],'major_code'=>$v_2['MajorCode'],'score_min'=>$v_2['LowestScore'],'weici_min'=>$v_2['LowestSection'],'dengxiao_weicha'=>$dengxiao_weicha,'linecha'=>$linecha,'major_code_standard'=>$v_2['MajorStandardCode'],'plan_nums'=>search_plan_like($list_plan_number,$v_2['MajorName'])];
						}
					}
			
		
					$result_major = GuguService::make('/metadata/ceemajorline',['appkey'=>'TZK6DJZ5LVS6V8LYDAS9WE3K4TM8ZQWZ','pageindex'=>1,'pagesize'=>10,'enrollprovince'=>$enrollprovince,'schooluuid'=>$v['SchoolUUID'],'year'=>$year,'minrange'=>$score_min.','.$score_max,'typename'=>$type,'batchname'=>$batchname]);
					//dump($result_major);die;
					if($result_major[0] != 200){
						return $this->show(2002,$result_major[1]??'error', '');
					}
					$list_major = $result_major[1][1];
					
					
			
					if(!empty($list_major)){
						$list_major = array_unique_two($list_major);//专业去重
						
						//获取院校的全部专业的招生计划
						$result_plan = GuguService::make('/metadata/college-enrollment-plan',['appkey'=>'4PRZZRKKA2QXJNHUF3222XWKCNTW7UYC','pageindex'=>1,'pagesize'=>100,'year'=>$year,'type'=>$type,'provincename'=>$enrollprovince,'schoolname'=>$v['CollegeName']]);
						if($result_plan[0] != 200){
							return $this->show(2002,$result_plan[1]??'error', '');
						}
						$list_plan = $result_plan[1][1];
						$list_plan_number = array_column($list_plan,'EnrollmentNumbers','CollegeMajorName');//整理好专业和招生人数，方便下面模糊匹配
						
						$list_new_major = [];
						foreach($list_major as $km=>$vm){
							
							if(empty($member['cj_rank'])){
								$dengxiao_weicha = '-';
							}else{
								if(!empty($vm['LowestSection']) && is_numeric($vm['LowestSection'])){
									$dengxiao_weicha = $vm['LowestSection']-$member['cj_rank'];
								}else{
									$dengxiao_weicha = '-';
								}
							}
				
							if(empty($batch_score)){
								$linecha = '-';
							}else{
								if(!empty($vm['LowestScore']) && is_numeric($vm['LowestScore'])){
									$linecha = $vm['LowestScore']-$batch_score;
								}else{
									$linecha = '-';
								}
							}
							
							$marjor_new_1 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
							foreach($list_new_1 as $vnl){
								if($vm['MajorName'] == $vnl['major_name']){
									$marjor_new_1 = $vnl;
									break;
								}
							}
							$marjor_new_2 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
							foreach($list_new_2 as $vn2){
								if($vm['MajorName'] == $vn2['major_name']){
									$marjor_new_2 = $vn2;
									break;
								}
							}
							
							$list_new_major[$km] = ['major_name'=>$vm['MajorName'],'major_code'=>$vm['MajorCode'],'score_min'=>$vm['LowestScore'],'weici_min'=>$vm['LowestSection'],'dengxiao_weicha'=>$dengxiao_weicha,'linecha'=>$linecha,'major_code_standard'=>$vm['MajorStandardCode'],'plan_nums'=>search_plan_like($list_plan_number,$vm['MajorName']),
							'score_min_1'=>$marjor_new_1['score_min']??'-','weici_min_1'=>$marjor_new_1['weici_min']??'-','dengxiao_weicha_1'=>$marjor_new_1['dengxiao_weicha']??'-','linecha_1'=>$marjor_new_1['linecha']??'-','plan_nums_1'=>$marjor_new_1['plan_nums']??'-',
							'score_min_2'=>$marjor_new_2['score_min']??'-','weici_min_2'=>$marjor_new_2['weici_min']??'-','dengxiao_weicha_2'=>$marjor_new_2['dengxiao_weicha']??'-','linecha_2'=>$marjor_new_2['linecha']??'-','plan_nums_2'=>$marjor_new_2['plan_nums']??'-'];
						}
						
						if(empty($member['cj_rank'])){
							$dengxiao_weicha = '-';
						}else{
							if(!empty($v['LowestRank']) && is_numeric($v['LowestRank'])){
								$dengxiao_weicha = $v['LowestRank']-$member['cj_rank'];
							}else{
								$dengxiao_weicha = '-';
							}
						}
						
						if(empty($batch_score)){
							$linecha = '-';
						}else{
							if(!empty($v['LowestScore']) && is_numeric($v['LowestScore'])){
								$linecha = $v['LowestScore']-$batch_score;
							}else{
								$linecha = '-';
							}
						}
						
						$school_new_1 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
						foreach($list_school_1 as $vsl){
							if($v['SchoolUUID'] == $vsl['school_uuid']){
								$school_new_1 = $vsl;
								break;
							}
						}
						$school_new_2 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
						foreach($list_school_2 as $vs2){
							if($v['SchoolUUID'] == $vs2['school_uuid']){
								$school_new_2 = $vs2;
								break;
							}
						}
						
						$list_new[] = ['college_name'=>$v['CollegeName'],'school_code'=>$school_code,'school_xingzhi'=>$v['SchoolType'],'school_type'=>$school_type,'school_suoshu'=>!empty($suoshu_list[$school_suoshu])?$suoshu_list[$school_suoshu]:'','school_tese'=>$school_tese,'province'=>$v['Province'],'city'=>$v['SchoolInCity'],'school_uuid'=>$v['SchoolUUID'],'subject_group'=>$v['SubjectGroup'],'score_min'=>$v['LowestScore'],'weici_min'=>$v['LowestRank'],'dengxiao_weicha'=>$dengxiao_weicha,'linecha'=>$linecha,
						'score_min_1'=>$school_new_1['score_min']??'-','weici_min_1'=>$school_new_1['weici_min']??'-','dengxiao_weicha_1'=>$school_new_1['dengxiao_weicha']??'-','linecha_1'=>$school_new_1['linecha']??'-','plan_nums_1'=>$school_new_1['plan_nums']??'-',
						'score_min_2'=>$school_new_2['score_min']??'-','weici_min_2'=>$school_new_2['weici_min']??'-','dengxiao_weicha_2'=>$school_new_2['dengxiao_weicha']??'-','linecha_2'=>$school_new_2['linecha']??'-','plan_nums_2'=>$school_new_2['plan_nums']??'-',
						'major_list'=>$list_new_major];//,'risk_level'=>'较高风险','risk_title'=>'冲'
					}
					
				}
			}
			
		}
		$count = count($list_new);
		
		
		//dump($list_new);die;
		
		$pages = ceil($count/$pagesize);
        $data = array('list'=>$list_new,'count'=>$count,'pages'=>$pages,'pagesize'=>$pagesize);	
		return $this->show(1,"成功", $data);
		
    }*/
	
	public function get_school_list()
    {
		set_time_limit(0); 
		
		$user_id = $this->user_id;
		$province_id = $this->province_id;
        $pagesize = 40;
        $page = 1; 
        $batch= $this->request->get("batch",1,'intval');
        if(empty($batch)){
            return $this->show(2001,"缺少参数batch!", '');
        }
        
        $school_ids_1= $this->request->get("school_ids",'','trim'); 
      
        $major_ids = $this->request->get("major_ids",'','trim');
		$major_ids = explode(',',$major_ids);
		$major_ids = array_filter(array_unique($major_ids));
		$major_school_ids = [];
		if(!empty($major_ids)){
			foreach($major_ids as $km=>$vm){
				$major_school_id = Db::name('school_major_data')->where('FIND_IN_SET(:id,major_ids)',['id' => $vm])->column('school_id');
				$major_school_ids = array_merge($major_school_ids,$major_school_id);
				
			}
		}
		//dump($major_ids);die;

    
		
		if(!empty($major_school_ids)){
			$map['id'] = ['in',$major_school_ids];
        }
		
		
		$map['status'] = 1;
		$school_ids_ed = Db::name("school")->where($map)->column('id');
		if(!empty($school_ids_1)){
			$school_ids_1 = explode(',',$school_ids_1);
			$school_ids_ed = array_filter(array_unique(array_merge($school_ids_ed,$school_ids_1))); 
		}
		//$school_list = Db::name("school")->where('id','in',$school_ids_ed)->column('school_uuid,id');
		//$school_uuids_ed = array_keys($school_list);
		$school_list = Db::name("school")->where('id','in',$school_ids_ed)->field('school_uuid,id,school_suoshu,college_code,school_type')->select();
		$school_uuids_ed = array_column($school_list,'school_uuid');
		$school_suoshu_ed = array_column($school_list,'school_suoshu','school_uuid');
		$school_id_ed = array_column($school_list,'id','school_uuid');
		$school_type_ed = array_column($school_list,'school_type','school_uuid');
		//dump($school_list);die;
		$school_tese = Db::name('school_tese_data')->alias('d')->join('school_tese t','d.tese_id=t.id')->where('d.school_id','in',$school_ids_ed)->field('d.school_id,t.title')->select();
		$school_tese_new = [];
		foreach($school_tese as $kt=>$vt){
			$school_tese_new[$vt['school_id']][] = $vt['title'];
			
		}
		//$school_type_ed = Db::name('school_type_data')->alias('d')->join('school_type t','d.type_id=t.id')->where('d.school_id','in',$school_ids_ed)->column('d.school_id,t.title');
		$school_type_arr = Db::name('school_type')->column('id,title');
		//$school_code_ed = Db::name('school')->where('id','in',$school_ids_ed)->column('id,college_code');
		$school_code_ed = array_column($school_list,'college_code','id');
       
		$enrollprovince = Db::name("area")->where('id',$province_id)->value('name');
		$year = date('Y',strtotime("-1 year"));
		$member = Db::name("member")->field('province_id,cj_score,cj_subjects,cj_subjects1,cj_subject_mode,cj_subject_mode_title,cj_rank')->where('id',$user_id)->find();
		$score_min = $member['cj_score']-30;
		$score_max = $member['cj_score']+30;
		$type = $member['cj_subject_mode_title'];
		
		
		if($batch == 1){
			$batchname = SchoolModel::getBenkeBtachs();
			$batch_score_name = '本科';
		}elseif($batch == 2){
			$batchname = SchoolModel::getZhuankeBtachs();
			$batch_score_name = '专科';
		}else{
			return $this->show(2001,"参数batch错误!", '');
		}
		$batch_score = Db::name("batch_line")->where('batch_name',$batch_score_name)->where('province_id',$province_id)->where('year',$year)->value('socre');//批次分数
		//dump($school_uuids_ed);die;
		
		$year1 = date('Y',strtotime("-2 year"));
		$year2 = date('Y',strtotime("-3 year"));
		$batch_score1 = Db::name("batch_line")->where('batch_name',$batch_score_name)->where('province_id',$province_id)->where('year',$year1)->value('socre');//批次分数
		$batch_score2 = Db::name("batch_line")->where('batch_name',$batch_score_name)->where('province_id',$province_id)->where('year',$year2)->value('socre');//批次分数
		
		if(cache('school_'.$user_id)){
			$data = cache('school_'.$user_id);
		}else{
			//$ZhiyuanNew = new ZhiyuanNew();
			//$data = $ZhiyuanNew->get_data_cache($user_id,$province_id);
			
			$result = ZhiyuanService::get_data_cache($user_id,$province_id);
			if($result[0] != 200){
				return $this->show(2002,$result[1]??'error', '');
			}
			$data = $result[1];
			
			Cache('school_'.$user_id,$data);
		}
		
		//dump($data);die;
		foreach($data as $k=>$v){
			if(!in_array($v['school_uuid'],$school_uuids_ed)){
				unset($data[$k]);
				continue;
			}
			$batchnames = explode(',',$batchname);
			if(!in_array($v['admission_batch'],$batchnames)){
				unset($data[$k]);
				continue;
			}
			if(!empty($score_min)){
				if($v['score_min']<$score_min){
					unset($data[$k]);
					continue;
				}
			}
			if(!empty($score_max)){
				if($v['score_min']>$score_max){
					unset($data[$k]);
					continue;
				}
			}
			$major_list = $v['major_list'];
			foreach($major_list as $km=>$vm){
				if(!in_array($vm['batch_name'],$batchnames)){
					unset($major_list[$km]);
					continue;
				}
			}
			if(empty($major_list)){
				unset($data[$k]);
				continue;
			}
			$data[$k]['major_list'] = $major_list;	
		}
		//dump($data);die;
		
		//$start = ($page - 1) * $pagesize;
		//$list = array_slice($data, $start, $pagesize);
		$chong_nums = 0;
		$wen_nums = 0;
		$bao_nums = 0;
		$data_chong = [];
		$data_wen = [];
		$data_bao = [];
		foreach($data as $k=>$v){
			$dengxiao_weicha = $v['dengxiao_weicha'];
			if($dengxiao_weicha>4000){//大于75%
				if($bao_nums>13) continue;
				$data_bao[] = $v;
				$bao_nums++;
			}elseif($dengxiao_weicha>-1 && $dengxiao_weicha<=4000){//大于46%,小于等于75%，
				if($wen_nums>12) continue;
				$data_wen[] = $v;
				$wen_nums++;
			}else{
				if($chong_nums>12) continue;
				$data_chong[] = $v;
				$chong_nums++;
			}
		}
		$list = array_merge($data_chong,$data_wen,$data_bao);
		//dump($list);die;
		
		//对当前数据进行处理
		//23年院校数据
		$school_uuids = array_column($list,'school_uuid');
		//dump($school_uuids);
		//$score_min = $member['cj_score']-50;
		//$score_max = $member['cj_score']+50;
		$list_1 = Db::name("school_line_new")->where('province_id',$province_id)->where('year',$year1)->where('type_name',$type)->where('school_uuid','in',$school_uuids)->where('admission_batch','in', $batchname)->where('lowest_rank','>',0)->field('school_uuid,lowest_score as score_min,lowest_rank as weici_min,course_selection_name as subject_group,admission_batch')->order('id asc')->select();
		//echo Db::name("school_line_new")->getlastsql();die;
		$list_1_new = $list_1_new_1 = [];
		foreach($list_1 as $k=>$v){
			if(empty($member['cj_rank'])){
				$dengxiao_weicha = '-';
			}else{
				if(!empty($v['weici_min']) && is_numeric($v['weici_min'])){
					$dengxiao_weicha = $v['weici_min']-$member['cj_rank'];
				}else{
					$dengxiao_weicha = '-';
				}
			}
			//院校线差
			if(empty($batch_score1)){
				$linecha_s1 = '-';
			}else{
				if(!empty($v['score_min']) && is_numeric($v['score_min'])){
					$linecha_s1 = $v['score_min']-$batch_score1;
				}else{
					$linecha_s1 = '-';
				}
			}
			//$list_1[$k]['dengxiao_weicha'] = $dengxiao_weicha;
			$v['dengxiao_weicha'] = $dengxiao_weicha;
			$v['linecha'] = $linecha_s1;
			if(!empty($v['subject_group'])){
				$v['subject_group'] = filter_subject_group($v['subject_group']);
			}
			$list_1_new[$v['school_uuid'].$v['admission_batch'].$v['subject_group']] = $v;
			$list_1_new_1[$v['school_uuid']] = $v;
		}
		
		//dump($list);
		//dump($list_1_new); die;
		//22年院校数据
		$list_2 = Db::name("school_line_new")->where('province_id',$province_id)->where('year',$year2)->where('type_name',$type)->where('school_uuid','in',$school_uuids)->where('admission_batch','in', $batchname)->where('lowest_rank','>',0)->field('school_uuid,lowest_score as score_min,lowest_rank as weici_min,course_selection_name as subject_group,admission_batch')->order('id asc')->select();
		$list_2_new = $list_2_new_2 = [];
		foreach($list_2 as $k=>$v){
			if(empty($member['cj_rank'])){
				$dengxiao_weicha = '-';
			}else{
				if(!empty($v['weici_min']) && is_numeric($v['weici_min'])){
					$dengxiao_weicha = $v['weici_min']-$member['cj_rank'];
				}else{
					$dengxiao_weicha = '-';
				}
			}
			//院校线差
			if(empty($batch_score2)){
				$linecha_s2 = '-';
			}else{
				if(!empty($v['score_min']) && is_numeric($v['score_min'])){
					$linecha_s2 = $v['score_min']-$batch_score2;
				}else{
					$linecha_s2 = '-';
				}
			}
			//$list_2[$k]['dengxiao_weicha'] = $dengxiao_weicha;
			$v['dengxiao_weicha'] = $dengxiao_weicha;
			$v['linecha'] = $linecha_s2;
			if(!empty($v['subject_group'])){
				$v['subject_group'] = filter_subject_group($v['subject_group']);
			}
			$list_2_new[$v['school_uuid'].$v['admission_batch'].$v['subject_group']] = $v;
			$list_2_new_2[$v['school_uuid']] = $v;
		}
		
		//获取去年院校下的专业的招生计划
		$plan_list = Db::name("school_plan_new")->where('province_id',$province_id)->where('year',$year)->where('type',$type)->where('school_uuid','in',$school_uuids)->where('enrollment_numbers','>',0)->field('school_uuid,college_major_code,college_major_name,enrollment_numbers')->order('id asc')->select();
		$plan_list_new = [];
		foreach($plan_list as $kp=>$vp){
			$plan_list_new[$vp['school_uuid']][] = $vp;
		}
		//dump($plan_list_new);die;
		
		//23年专业数据
		$major_list_1 = Db::name("major_line_new")->where('province_id',$province_id)->where('year',$year1)->where('type_name',$type)->where('school_uuid','in',$school_uuids)->where('lowest_section','>',0)->field('school_uuid,lowest_score as score_min,lowest_section as weici_min,major_name,major_code,batch_name,subject_group')->order('id asc')->select();
		//23年招生计划
		$plan_list_1 = Db::name("school_plan_new")->where('province_id',$province_id)->where('year',$year1)->where('type',$type)->where('school_uuid','in',$school_uuids)->where('enrollment_numbers','>',0)->field('school_uuid,school_name,college_major_code,college_major_name,enrollment_numbers')->order('id asc')->select();
		$plan_list_new_1 = [];
		foreach($plan_list_1 as $kp=>$vp){
			$plan_list_new_1[$vp['school_uuid']][] = $vp;
		}
		$major_list_new_1 = [];
		foreach($major_list_1 as $km=>$vm){
			if(empty($member['cj_rank'])){
				$dengxiao_weicha = '-';
			}else{
				if(!empty($vm['weici_min']) && is_numeric($vm['weici_min'])){
					$dengxiao_weicha = $vm['weici_min']-$member['cj_rank'];
				}else{
					$dengxiao_weicha = '-';
				}
			}
			if(empty($batch_score)){
				$linecha = '-';
			}else{
				if(!empty($vm['score_min']) && is_numeric($vm['score_min'])){
					$linecha = $vm['score_min']-$batch_score;
				}else{
					$linecha = '-';
				}
			}
			$vm['dengxiao_weicha'] = $dengxiao_weicha;
			$vm['linecha'] = $linecha;
			$vm['plan_nums'] = '-';
			$major_list_new_1[$vm['school_uuid']][] = $vm;
		}
		//22年专业数据
		$major_list_2 = Db::name("major_line_new")->where('province_id',$province_id)->where('year',$year2)->where('type_name',$type)->where('school_uuid','in',$school_uuids)->where('lowest_section','>',0)->field('school_uuid,lowest_score as score_min,lowest_section as weici_min,major_name,major_code,batch_name,subject_group')->order('id asc')->select();
		//22年招生计划
		$plan_list_2 = Db::name("school_plan_new")->where('province_id',$province_id)->where('year',$year2)->where('type',$type)->where('school_uuid','in',$school_uuids)->where('enrollment_numbers','>',0)->field('school_uuid,college_major_code,college_major_name,enrollment_numbers')->order('id asc')->select();
		$plan_list_new_2 = [];
		foreach($plan_list_2 as $kp=>$vp){
			$plan_list_new_2[$vp['school_uuid']][] = $vp;
		}
		$major_list_new_2 = [];
		foreach($major_list_2 as $km=>$vm){
			if(empty($member['cj_rank'])){
				$dengxiao_weicha = '-';
			}else{
				if(!empty($vm['weici_min']) && is_numeric($vm['weici_min'])){
					$dengxiao_weicha = $vm['weici_min']-$member['cj_rank'];
				}else{
					$dengxiao_weicha = '-';
				}
			}
			if(empty($batch_score)){
				$linecha = '-';
			}else{
				if(!empty($vm['score_min']) && is_numeric($vm['score_min'])){
					$linecha = $vm['score_min']-$batch_score;
				}else{
					$linecha = '-';
				}
			}
			$vm['dengxiao_weicha'] = $dengxiao_weicha;
			$vm['linecha'] = $linecha;
			$vm['plan_nums'] = '-';
			$major_list_new_2[$vm['school_uuid']][] = $vm;
		}
		
		
		foreach($list as $kt=>$vt){
			//去年院校线差
			if(empty($batch_score)){
				$linecha_s = '-';
			}else{
				if(!empty($vt['score_min']) && is_numeric($vt['score_min'])){
					$linecha_s = $vt['score_min']-$batch_score;
				}else{
					$linecha_s = '-';
				}
			}
			$list[$kt]['linecha'] = $linecha_s;
			//匹配23年院校数据
			if(!empty($vt['subject_group'])){
				$vt['subject_group'] = filter_subject_group($vt['subject_group']);
			}
			if(!empty($list_1_new[$vt['school_uuid'].$vt['admission_batch'].$vt['subject_group']])){
				$school_new_1 = $list_1_new[$vt['school_uuid'].$vt['admission_batch'].$vt['subject_group']]; 
			}else{
				if(!empty($list_1_new_1[$vt['school_uuid']])){
					$school_new_1 = $list_1_new_1[$vt['school_uuid']]; 
				}else{
					$school_new_1 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
				}
			}
			
			//匹配22年院校数据
			if(!empty($list_2_new[$vt['school_uuid'].$vt['admission_batch'].$vt['subject_group']])){
				$school_new_2 = $list_2_new[$vt['school_uuid'].$vt['admission_batch'].$vt['subject_group']]; 
			}else{
				if(!empty($list_2_new_2[$vt['school_uuid']])){
					$school_new_2 = $list_2_new_2[$vt['school_uuid']]; 
				}else{
					$school_new_2 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
				}
			}
			$list[$kt]['score_min_1'] = $school_new_1['score_min']??'-'; 
			$list[$kt]['weici_min_1'] = $school_new_1['weici_min']??'-';
			$list[$kt]['linecha_1'] = $school_new_1['linecha']??'-'; 
			$list[$kt]['dengxiao_weicha_1'] = $school_new_1['dengxiao_weicha']??'-';
			$list[$kt]['score_min_2'] = $school_new_2['score_min']??'-'; 
			$list[$kt]['weici_min_2'] = $school_new_2['weici_min']??'-';
			$list[$kt]['linecha_2'] = $school_new_2['linecha']??'-'; 
			$list[$kt]['dengxiao_weicha_2'] = $school_new_2['dengxiao_weicha']??'-';
			//dump($list[$kt]);die;
			//处理专业
			foreach($list[$kt]['major_list'] as $km=>$vm){
				//匹配去年专业招生计划
				$plan_list_new_tem = !empty($plan_list_new[$vt['school_uuid']])?$plan_list_new[$vt['school_uuid']]:[];
				$list[$kt]['major_list'][$km]['plan_nums'] = search_plan_like_major($plan_list_new_tem,$vm['major_name'],$vt['school_uuid']);
				//计算去年专业线差
				if(empty($batch_score)){
					$linecha = '-';
				}else{
					if(!empty($vm['score_min']) && is_numeric($vm['score_min'])){
						$linecha = $vm['score_min']-$batch_score;
					}else{
						$linecha = '-';
					}
				}
				$list[$kt]['major_list'][$km]['linecha'] = $linecha;
				
				//匹配23年专业数据 
				$marjor_new_1 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
				if(!empty($major_list_new_1[$vt['school_uuid']])){
					$marjor_new_1 = search_major_like($major_list_new_1[$vt['school_uuid']],$vm['major_name']);
				}
				//匹配23年计划
				$plan_list_new_tem_1 = !empty($plan_list_new_1[$vt['school_uuid']])?$plan_list_new_1[$vt['school_uuid']]:[];
				$marjor_new_1['plan_nums'] = search_plan_like_major($plan_list_new_tem_1,$vm['major_name'],$vt['school_uuid']);
				$list[$kt]['major_list'][$km]['score_min_1'] = $marjor_new_1['score_min'];
				$list[$kt]['major_list'][$km]['weici_min_1'] = $marjor_new_1['weici_min'];
				$list[$kt]['major_list'][$km]['dengxiao_weicha_1'] = $marjor_new_1['dengxiao_weicha'];
				$list[$kt]['major_list'][$km]['linecha_1'] = $marjor_new_1['linecha'];
				$list[$kt]['major_list'][$km]['plan_nums_1'] = $marjor_new_1['plan_nums']??'-';
				
				//匹配22年专业数据 
				$marjor_new_2 = ['score_min'=>'-','weici_min'=>'-','dengxiao_weicha'=>'-','linecha'=>'-','plan_nums'=>'-'];
				if(!empty($major_list_new_2[$vt['school_uuid']])){
					$marjor_new_2 = search_major_like($major_list_new_2[$vt['school_uuid']],$vm['major_name']);
				}			
				//匹配22年计划
				$plan_list_new_tem_2 = !empty($plan_list_new_2[$vt['school_uuid']])?$plan_list_new_2[$vt['school_uuid']]:[];
				$marjor_new_2['plan_nums'] = search_plan_like_major($plan_list_new_tem_2,$vm['major_name'],$vm['school_uuid']);
				$list[$kt]['major_list'][$km]['score_min_2'] = $marjor_new_2['score_min'];
				$list[$kt]['major_list'][$km]['weici_min_2'] = $marjor_new_2['weici_min'];
				$list[$kt]['major_list'][$km]['dengxiao_weicha_2'] = $marjor_new_2['dengxiao_weicha'];
				$list[$kt]['major_list'][$km]['linecha_2'] = $marjor_new_2['linecha'];
				$list[$kt]['major_list'][$km]['plan_nums_2'] = $marjor_new_2['plan_nums']??'-';
				
				
				
			}
		
		}
		
        $data = array('list'=>$list,'count'=>$pagesize,'pages'=>1,'pagesize'=>$pagesize);	
		return $this->show(1,"成功", $data);
		
    }
	
}